bitkeeper revision 1.1400 (4284b9fcQX9z9IzwMeHwdHYRkEIjFA)
authorxenbk@gandalf.hpl.hp.com <xenbk@gandalf.hpl.hp.com>
Fri, 13 May 2005 14:30:20 +0000 (14:30 +0000)
committerxenbk@gandalf.hpl.hp.com <xenbk@gandalf.hpl.hp.com>
Fri, 13 May 2005 14:30:20 +0000 (14:30 +0000)
Merge

1  2 
.rootkeys
tools/python/xen/xend/XendClient.py
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/server/SrvDomain.py
tools/python/xen/xm/main.py

diff --cc .rootkeys
Simple merge
Simple merge
Simple merge
index 9351e335c185bccf5591a163874a6a1114aaffa4,2af99694ab7aa121f92f7c63b024fe06bf089ff8..1fdfd4ca5ac1bb46b73ca8dfdd4c1efcf13b3d9a
@@@ -492,51 -442,40 +496,52 @@@ class XendDomainInfo
          # todo - add support for scheduling params?
          self.config = config
          try:
 +            # Initial domain create.
              self.name = sxp.child_value(config, 'name')
              self.check_name(self.name)
 -            try:
 -                self.cpu_weight = float(sxp.child_value(config, 'cpu_weight', '1'))
 -            except:
 -                raise VmError('invalid cpu weight')
 -            self.memory = int(sxp.child_value(config, 'memory'))
 -            if self.memory is None:
 -                raise VmError('missing memory size')
 -            cpu = sxp.child_value(config, 'cpu')
 -            if self.recreate and self.dom and cpu is not None:
 -                xc.domain_pincpu(self.dom, 0, 1<<int(cpu))
 -            try:
 -                image = sxp.child_value(self.config, 'image')
 -                self.vcpus = int(sxp.child_value(image, 'vcpus'))
 -            except:
 -                raise VmError('invalid vcpus value')
 -
 +            self.configure_cpus(config)
              self.find_image_handler()
              self.init_domain()
 -            self.configure_console()
 +            self.register_domain()
 +            self.configure_bootloader()
 +
 +            # Create domain devices.
              self.configure_backends()
 -            self.construct_image()
 +            self.configure_console()
              self.configure_restart()
 -            deferred = self.configure()
 -            def cberr(err):
 -                self.destroy()
 -                return err
 -            deferred.addErrback(cberr)
 -        except StandardError, ex:
 +            self.construct_image()
 +            self.configure()
 +        except Exception, ex:
              # Catch errors, cleanup and re-raise.
 +            print 'Domain construction error:', ex
 +            import traceback
 +            traceback.print_exc()
              self.destroy()
              raise
 -        return deferred
 +
 +    def register_domain(self):
 +        xd = get_component('xen.xend.XendDomain')
 +        xd._add_domain(self)
 +
 +    def configure_cpus(self, config):
 +        try:
 +            self.cpu_weight = float(sxp.child_value(config, 'cpu_weight', '1'))
 +        except:
 +            raise VmError('invalid cpu weight')
 +        self.memory = int(sxp.child_value(config, 'memory'))
 +        if self.memory is None:
 +            raise VmError('missing memory size')
 +        cpu = sxp.child_value(config, 'cpu')
 +        if self.recreate and self.dom and cpu is not None:
-             xc.domain_pincpu(self.dom, int(cpu))
++            #xc.domain_pincpu(self.dom, int(cpu))
++            xc.domain_pincpu(self.dom, 0, 1<<int(cpu))
 +        try:
 +            image = sxp.child_value(self.config, 'image')
 +            vcpus = sxp.child_value(image, 'vcpus')
 +            if vcpus:
 +                self.vcpus = int(vcpus)
 +        except:
 +            raise VmError('invalid vcpus value')
  
      def find_image_handler(self):
          """Construct the boot image for the domain.
Simple merge